/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TavoloGUI.java
 *
 * Created on 16-mar-2011, 9.52.06
 */

package Grafica;

import Gioco.*;
import java.awt.Dimension;
import java.awt.Toolkit;

/**
 *
 * @author Luca
 */
public class TavoloGUI extends javax.swing.JFrame {
    Dimension dimension;
    /** Creates new form TavoloGUI */
    public TavoloGUI() {
        initComponents();
        dimension = Toolkit.getDefaultToolkit().getScreenSize();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        sfondo = new Grafica.PannelloConSfondo("images/panno.png");
        steccaGiu = new Grafica.PannelloConSfondo("images/0/stecca2.png");
        GiuScoperte = new Grafica.FilaDiPedine(Costanti.GIU);
        GiuInMano = new Grafica.FilaDiPedine(Costanti.GIU);
        steccaSinistra = new Grafica.PannelloConSfondo("images/90/stecca2.png");
        sinistraScoperte = new Grafica.FilaDiPedine(Costanti.SINISTRA);
        sinistraInMano = new Grafica.FilaDiPedine(Costanti.SINISTRA,true);
        steccaSu = new Grafica.PannelloConSfondo("images/180/stecca2.png");
        suInMano = new Grafica.FilaDiPedine(Costanti.SU,true);
        suScoperte = new Grafica.FilaDiPedine(Costanti.SU);
        steccaDestra = new Grafica.PannelloConSfondo("images/270/stecca2.png");
        destraScoperte = new Grafica.FilaDiPedine(Costanti.DESTRA);
        destraInMano = new Grafica.FilaDiPedine(Costanti.DESTRA,true);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        steccaGiu.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        steccaGiu.setOpaque(false);

        GiuScoperte.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        GiuScoperte.setOpaque(false);
        GiuScoperte.setLayout(new java.awt.GridLayout(1, 14));

        GiuInMano.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        GiuInMano.setOpaque(false);
        GiuInMano.setLayout(new java.awt.GridLayout(1, 14));

        javax.swing.GroupLayout steccaGiuLayout = new javax.swing.GroupLayout(steccaGiu);
        steccaGiu.setLayout(steccaGiuLayout);
        steccaGiuLayout.setHorizontalGroup(
            steccaGiuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(steccaGiuLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(steccaGiuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(GiuInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 826, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(GiuScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 826, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        steccaGiuLayout.setVerticalGroup(
            steccaGiuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, steccaGiuLayout.createSequentialGroup()
                .addContainerGap(54, Short.MAX_VALUE)
                .addComponent(GiuScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(GiuInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(9, 9, 9))
        );

        steccaSinistra.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        steccaSinistra.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        steccaSinistra.setMaximumSize(new java.awt.Dimension(5, 5));
        steccaSinistra.setOpaque(false);

        sinistraScoperte.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        sinistraScoperte.setOpaque(false);
        sinistraScoperte.setLayout(new java.awt.GridLayout(14, 1));

        sinistraInMano.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        sinistraInMano.setOpaque(false);
        sinistraInMano.setLayout(new java.awt.GridLayout(14, 1));

        javax.swing.GroupLayout steccaSinistraLayout = new javax.swing.GroupLayout(steccaSinistra);
        steccaSinistra.setLayout(steccaSinistraLayout);
        steccaSinistraLayout.setHorizontalGroup(
            steccaSinistraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, steccaSinistraLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(sinistraInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                .addComponent(sinistraScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        steccaSinistraLayout.setVerticalGroup(
            steccaSinistraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, steccaSinistraLayout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addGroup(steccaSinistraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(sinistraInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sinistraScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        steccaSu.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        steccaSu.setOpaque(false);

        suInMano.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        suInMano.setOpaque(false);
        suInMano.setVerifyInputWhenFocusTarget(false);
        suInMano.setLayout(new java.awt.GridLayout(1, 14));

        suScoperte.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        suScoperte.setOpaque(false);
        suScoperte.setVerifyInputWhenFocusTarget(false);
        suScoperte.setLayout(new java.awt.GridLayout(1, 14));

        javax.swing.GroupLayout steccaSuLayout = new javax.swing.GroupLayout(steccaSu);
        steccaSu.setLayout(steccaSuLayout);
        steccaSuLayout.setHorizontalGroup(
            steccaSuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(steccaSuLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(suInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, steccaSuLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(suScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        steccaSuLayout.setVerticalGroup(
            steccaSuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(steccaSuLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(suInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(suScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        steccaDestra.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        steccaDestra.setMaximumSize(new java.awt.Dimension(200, 700));
        steccaDestra.setOpaque(false);

        destraScoperte.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        destraScoperte.setOpaque(false);
        destraScoperte.setLayout(new java.awt.GridLayout(14, 1));

        destraInMano.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        destraInMano.setOpaque(false);
        destraInMano.setLayout(new java.awt.GridLayout(14, 1));

        javax.swing.GroupLayout steccaDestraLayout = new javax.swing.GroupLayout(steccaDestra);
        steccaDestra.setLayout(steccaDestraLayout);
        steccaDestraLayout.setHorizontalGroup(
            steccaDestraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(steccaDestraLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(destraScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                .addComponent(destraInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        steccaDestraLayout.setVerticalGroup(
            steccaDestraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(steccaDestraLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(steccaDestraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(destraScoperte, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(destraInMano, javax.swing.GroupLayout.PREFERRED_SIZE, 408, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout sfondoLayout = new javax.swing.GroupLayout(sfondo);
        sfondo.setLayout(sfondoLayout);
        sfondoLayout.setHorizontalGroup(
            sfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sfondoLayout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(steccaSinistra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(sfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(sfondoLayout.createSequentialGroup()
                        .addGap(288, 288, 288)
                        .addComponent(steccaSu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(sfondoLayout.createSequentialGroup()
                        .addGap(52, 52, 52)
                        .addComponent(steccaGiu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(94, 94, 94)
                .addComponent(steccaDestra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(115, 115, 115))
        );
        sfondoLayout.setVerticalGroup(
            sfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sfondoLayout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addGroup(sfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(sfondoLayout.createSequentialGroup()
                        .addComponent(steccaDestra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(sfondoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(sfondoLayout.createSequentialGroup()
                            .addComponent(steccaSu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 458, Short.MAX_VALUE)
                            .addComponent(steccaGiu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap())
                        .addGroup(sfondoLayout.createSequentialGroup()
                            .addComponent(steccaSinistra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(31, 31, 31)))))
        );

        getContentPane().add(sfondo, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TavoloGUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel GiuInMano;
    private javax.swing.JPanel GiuScoperte;
    private javax.swing.JPanel destraInMano;
    private javax.swing.JPanel destraScoperte;
    private javax.swing.JPanel sfondo;
    private javax.swing.JPanel sinistraInMano;
    private javax.swing.JPanel sinistraScoperte;
    private javax.swing.JPanel steccaDestra;
    private javax.swing.JPanel steccaGiu;
    private javax.swing.JPanel steccaSinistra;
    private javax.swing.JPanel steccaSu;
    private javax.swing.JPanel suInMano;
    private javax.swing.JPanel suScoperte;
    // End of variables declaration//GEN-END:variables

}
